import request from "@/api/request.js";

export default {
    // 获取电池护照列表（分页）
    getBatteryPassports(params) {
        return request({
            url: '/api/battery-passports/page',
            method: 'get',
            params
        })
    },

    // 获取电池护照详情（通过ID）
    getBatteryPassportById(id) {
        return request({
            url: `/api/battery-passports/${id}`,
            method: 'get'
        })
    },

    // 根据标识符查询电池护照
    getBatteryPassportByIdentifier(identifier) {
        return request({
            url: `/api/battery-passports/by-identifier/${identifier}`,
            method: 'get'
        })
    },

    // 创建电池护照
    createBatteryPassport(data) {
        return request({
            url: '/api/battery-passports',
            method: 'post',
            data
        })
    },

    // 更新电池护照
    updateBatteryPassport(id, data) {
        return request({
            url: `/api/battery-passports/${id}`,
            method: 'put',
            data
        })
    },

    // 删除电池护照
    deleteBatteryPassport(id) {
        return request({
            url: `/api/battery-passports/${id}`,
            method: 'delete'
        })
    },

    publishBattery(data) {
        return request({
            url: '/api/battery-passports/publish',
            method: 'post',
            data
        })
    },

    countByPublishStatus() {
        return request({
            url: '/api/battery-passports/countByPublishStatus',
            method: 'get',
        })
    },
    countByMonth() {
        return request({
            url: '/api/battery-passports/countByMonth',
            method: 'get',
        })
    },
    countByYear() {
        return request({
            url: '/api/battery-passports/countByYear',
            method: 'get',
        })
    },
    countByModel() {
        return request({
            url: '/api/battery-passports/countByModel',
            method: 'get',
        })
    },
    countByManufacturer() {
        return request({
            url: '/api/battery-passports/countByManufacturer',
            method: 'get',
        })
    },
}